import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { LotappositivecarVO, LotappositivecarForm, LotappositivecarQuery } from '@/api/access/parking-lot/parking-lot-appositive-car/types';

/**
 * 查询停车场-同位车列表
 * @param query
 * @returns {*}
 */

export const listLotappositivecar = (query?: LotappositivecarQuery): AxiosPromise<LotappositivecarVO[]> => {
  return request({
    url: '/parkinglot/lotAppositiveCar/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询停车场-同位车详细
 * @param parkingLotAppositiveCarId
 */
export const getLotappositivecar = (parkingLotAppositiveCarId: string | number): AxiosPromise<LotappositivecarVO> => {
  return request({
    url: '/parkinglot/lotAppositiveCar/' + parkingLotAppositiveCarId,
    method: 'get'
  });
};

/**
 * 新增停车场-同位车
 * @param data
 */
export const addLotappositivecar = (data: LotappositivecarForm) => {
  return request({
    url: '/parkinglot/lotAppositiveCar',
    method: 'post',
    data: data
  });
};

/**
 * 修改停车场-同位车
 * @param data
 */
export const updateLotappositivecar = (data: LotappositivecarForm) => {
  return request({
    url: '/parkinglot/lotAppositiveCar',
    method: 'put',
    data: data
  });
};

/**
 * 删除停车场-同位车
 * @param parkingLotAppositiveCarId
 */
export const delLotappositivecar = (parkingLotAppositiveCarId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotAppositiveCar/' + parkingLotAppositiveCarId,
    method: 'delete'
  });
};
